/*
 * =====================================================================================
 *
 *       Filename:  main.cpp
 *
 *    Description:
 *
 *        Version:  1.0
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  Fang Dongheng (fndisme), fndisme@163.com
 *   Organization:
 *
 * =====================================================================================
 */
#include <sstream>
#include <iostream>
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/json_parser.hpp>
#include "base/Message.h"

int main() {
	using namespace FakeWeiXin;
	Message m;
	boost::property_tree::ptree tree;
	std::string n("fndi");
	n.push_back(0);
	n += "sme";
	tree.put("name", n);
	auto name = tree.get<std::string>("name");
	std::cout << name << " " << name.size() << std::endl;
	std::stringstream s;
	write_json(s, tree, false);
	m.fillMessage(1, s.str());
	m.debugPrint();
	auto b = m.toBuffer();
	std::cout << "buffer size " << b.size() << "\n";
}

